package com.wanmait.translate.system.controller;

import com.github.pagehelper.PageInfo;
import com.wanmait.translate.dto.ResultData;
import com.wanmait.translate.pojo.SystemUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system")
public class SystemUserController  extends SystemParentController{

    private Logger LOG= LoggerFactory.getLogger(SystemUserController.class);
    /**
     * @Author huweibin
     * @Description 获得所有用户，参数为为条件，不传为查询所有（number工号，name 姓名，post 岗位）
     * @Date 15:54 2020/11/14
     **/
    @RequestMapping("/user/list")
    public ResultData<SystemUser> listByCondition(Integer page, Integer limit, SystemUser systemUser) {
        //默认查询启用的
        systemUser.setEnable(0);
        LOG.info("接收到参数pageNumber:{},pageSize:{},SystemUser{}",page,limit,systemUser);
        PageInfo<SystemUser> pageInfo=systemUserService.listByCondition( page,limit,systemUser);
        return ResultData.SuccesssWithData(pageInfo);
    }


    @RequestMapping("/userList")
    public void userList() {
    }

    @RequestMapping("/addUser")
    public void addUser() {
    }

    @RequestMapping("/roleList")
    public void roleList() {
    }

    @RequestMapping("/addRole")
    public void addRole(){}
}